package pl.com.qapps.datastore.berkeley;

import java.util.Iterator;

public abstract class IteratorWrapper<W, T> implements Iterator<T> {

	private Iterator<W> wrapped;

	public IteratorWrapper(Iterator<W> wrapped) {
		super();
		this.wrapped = wrapped;
	}

	protected abstract T wrap(W item);

	@Override
	public boolean hasNext() {
		return wrapped.hasNext();
	}

	@Override
	public T next() {
		return wrap(wrapped.next());
	}

	@Override
	public void remove() {
		wrapped.remove();
	}

}
